package com.cn.dream_order_server.service.impl;

import com.cn.dream_order_server.mapper.OrderLogisticsMapper;
import com.cn.dream_order_server.pojo.OrderLogistics;
import com.cn.dream_order_server.service.OrderLogisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderLogisticsServiceImpl implements OrderLogisticsService {


    @Autowired
    private OrderLogisticsMapper orderLogisticsMapper;


    @Override
    public Integer savaOrderLogistics(OrderLogistics orderLogistics) {
        return orderLogisticsMapper.insertSelective(orderLogistics);
    }

    @Override
    public Integer updateOrderLogisticsByOrderLogisticsId(OrderLogistics orderLogistics) {
        if (orderLogisticsMapper.selectByPrimaryKey(orderLogistics.getLogisticsId())!= null){
            return orderLogisticsMapper.updateByPrimaryKeySelective(orderLogistics);
        }
        return null;
    }
}
